﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<link rel="stylesheet" type="text/css" href="${contextPath }/jsp/css/css.css"/>
<script type="text/javascript" src="${contextPath }/jsp/js/refreshClock.js">
</script>
<script type="text/javascript" src="${contextPath }/jsp/js/showProducts.js">
</script>
<jsp:include page="/jsp/include/logo.jsp"></jsp:include>
<c:choose>
	<c:when test="${logined}">
		<jsp:include page="/jsp/include/loginedHead.jsp"></jsp:include>
	</c:when>
	<c:otherwise>
		<jsp:include page="/jsp/include/header.jsp"></jsp:include>
	</c:otherwise>
</c:choose>
<c:choose>
	<c:when test="${state==0}">
		<c:set var="bgImage" value="jjsj.jpg" />
	</c:when>
	<c:when test="${state==1}">
		<c:set var="bgImage" value="jpsplb.gif" />
<script type="text/javascript">
// 开始运行
window.onload = function(){
	
// nextelapse是定时时间, 初始时为100毫秒
// 注意setInterval函数: 时间逝去nextelapse(毫秒)后, onTimer才开始执行
	//alert(nextelapse);
	timer = window.setInterval(onTimer, nextelapse); 
	
    autoFlag=window.setInterval(sendRequest,5000);

	
}

</script>
	</c:when>
	<c:otherwise>
		<c:set var="bgImage" value="yjjs.jpg" />
	</c:otherwise>
</c:choose>

<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td>&nbsp;
		</td>
	</tr>
</table>

<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td><img src="${contextPath }/jsp/images/bg_1.gif" width="960" height="69" border="0" usemap="#Map" /></td>
	</tr>
	<tr>
		<td height="10"></td>
	</tr>
</table>
<map name="Map">
	<area shape="rect" coords="811,11,939,58" href="${contextPath }/jsp/help.jsp#saleReturn">
	<area shape="rect" coords="653,12,781,59" href="${contextPath }/jsp/help.jsp#delivery">
	<area shape="rect" coords="493,12,621,59" href="${contextPath }/jsp/help.jsp#auction" target="_self">
	<area shape="rect" coords="334,12,462,59" href="${contextPath }/jsp/index.jsp#moreAuction">
	<area shape="rect" coords="177,12,305,59" href="${contextPath }/jsp/buyGoldBid.jsp">
	<area shape="rect" coords="20,11,148,58" href="${contextPath }/jsp/regist.jsp">
</map>


<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="500" align="left" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
	<td width="100%" height="30" align="left" valign="bottom" background="${contextPath }/jsp/images/${bgImage }">&nbsp;
	</td>
  </tr>
  <tr>
	<td width="100%" height="150" valign="top" background="${contextPath }/jsp/images/bg_15.gif">
	
		<table width="920" height="40" align="center">
		   <tr>
		     <td width="15%" align="center">商品图片</td>
		     <td width="35%" align="center">商品名称</td>
		     <td width="15%" align="center">最新价格</td>
		     <td width="20%" align="center">最后竞价会员</td>
		     <td width="15%" align="center">倒计时</td>
		   </tr>
		</table>
		<c:forEach var="i" begin="0" step="1" end="${fn:length(pageCutProList)-1 }">
		<table background="${contextPath }/jsp/images/bg_22.gif" width="920" align="center" height="138">
		   <tr height="5"><td>&nbsp;</td></tr>
		   <tr>
		     <td width="15%" align="center">
		   	   <table width="140" border="0" cellpadding="0" cellspacing="0" class="product_lPaniel">
					<tr>
						<td align="center" background="${contextPath }/jsp/images/bg_13.gif">
							<img src="${contextPath }/jsp/proimages/${pageCutProList[i].image1 }" alt="" width="130" height="120" border="0" onclick="window.location='${contextPath }/product.do?operation=showProMsg&productId=${pageCutProList[i].productId}'" style="cursor:pointer;"/>
						</td>
					</tr>
			   </table>
		     </td>
		     <td width="35%" align="center">${pageCutProList[i].productName }</td>
		     <td width="15%" align="center">${pageCutProList[i].currentPrice }￥</td>
		     <c:if test="${lastBidder[pageCutProList[i].productId] eq null }">
		     	<td width="20%" align="center">暂无</td>
		     </c:if>
		     <c:if test="${lastBidder[pageCutProList[i].productId] ne null }">
		     	<td align="center">${lastBidder[pageCutProList[i].productId] }</td>
		     </c:if>
		     <c:if test="${state ne 1}">
		     	<td width="15%" align="center">--:--:--</td>
		     </c:if>
		     <c:if test="${state eq 1}">
		     	<td width="15%" align="center">
		     	<div id="remainTime${i}">${pageCutProList[i].auctioning.remainTime }</div>
        		<input type="hidden" id="auctioningId${i }" value=${pageCutProList[i].auctioning.auctioningId } />
		     	</td>
		     </c:if>
		   </tr>
		   <tr>
		     <td width="10">&nbsp;</td>
		   </tr>
		</table>
		</c:forEach>	
		<table>
		   <tr><td align="center" background="${contextPath }/jsp/images/bg_15.gif">&nbsp;</td></tr>
		</table>		
	</td>
  </tr>
  <tr>
    <td>
      <table align="center" id="cuts"><tr>
    	<td><a href="${contextPath }/product.do?operation=showAllByState&state=${state}&page=1&back=0"
    		   id="firstPage" name="firstPage" onclick="return switchPage1(this);">首页&nbsp;&nbsp;</a></td>
    	<td><a href="${contextPath }/product.do?operation=showAllByState&state=${state}&page=${currentPage-1 }&back=0"
    	       id="frontPage" onclick="return switchPage1();">上一页&nbsp;&nbsp;</a></td>
    	<td><a href="${contextPath }/product.do?operation=showAllByState&state=${state}&page=${currentPage+1 }&back=0"
    		   id="nextPage" onclick="return switchLastPage2();">下一页&nbsp;&nbsp;</a><td>
    	<td><a href="${contextPath }/product.do?operation=showAllByState&state=${state}&page=${lastPage}&back=0"
    		   id="endPage" onclick="return switchLastPage2();">末页&nbsp;&nbsp;</a><td>
        <td>${currentPage }/${lastPage }</td>
    	<input type="hidden" id="pageCurrent" value="${currentPage }" />
    	<input type="hidden" id="pageLast" value="${lastPage }" />
    </tr></table>
    </td>
  </tr>

  <tr>
	<td><img src="${contextPath }/jsp/images/bg_11.gif" width="960" height="24" title="" alt="有拍网，中国第一，娱乐购物，全新模式，拍卖，低价，有点，手机，mp3，mp4，摄影，摄像，数码相机，车载，试听设备，电脑/设备，化妆品" />
	</td>
  </tr>
</table>
</td>
</tr>
</table>

<table width="960" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="10"></td>
  </tr>
</table>
<jsp:include page="/jsp/include/footer.jsp"></jsp:include>
